package com.ruoyi.statistics.api;

import com.ruoyi.order.api.domain.ErpSellerOrder;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(contextId = "remoteOrderStatisticsService", value = ServiceNameConstants.STATISTICS_SERVICE)
public interface RemoteOrderStatisticsService {


    /**
     * 根据子订单号，查询子订单统计信息
     * @param childOrderId
     * @return
     */
    @GetMapping("/statistics/order/getByChildOrderId/{childOrderId}")
    R<Object> getByChildOrderId(@PathVariable("childOrderId") String childOrderId);

    /**
     * 根据订单号，查询订单统计信息
     * @param orderId
     * @return
     */
    @GetMapping("/statistics/order/getByOrderId/{orderId}")
    R<Object> getByOrderId(@PathVariable("orderId") String orderId);

    /**
     * 保存订单和子订单的商品金额信息(利润等)
     * @param sellerOrder
     * @return
     */
    @GetMapping("/statistics/order/saveOrderProfitInfo")
    R<Object> saveOrderProfitInfo(@RequestBody ErpSellerOrder sellerOrder);

    /**
     * 根据条件查询数据列表
     * @param storeId
     * @param startTime
     * @param endTime
     * @return
     */
    @GetMapping("/statistics/order/getChildOrderStatisticsList/{storeId}/{startTime}/{endTime}")
    R<Object> getChildOrderStatisticsList(@PathVariable("storeId") String storeId,
                                                 @PathVariable("startTime") String startTime,
                                                 @PathVariable("endTime") String endTime);

}
